package com.beteng.su.betengsu.base;

import android.os.Bundle;

import com.beteng.su.betengsu.net.RxSubscriber;
import com.blankj.utilcode.util.EmptyUtils;

import org.reactivestreams.Subscription;

import cn.droidlover.xdroid.base.XActivity;
import dmax.dialog.SpotsDialog;

/**
 * Created by chenzhimin on 2017/9/5.
 */

public abstract class BaseActivity extends XActivity {
    protected SpotsDialog mLoadingView;

    protected void showLoading(String msg){
        if (EmptyUtils.isEmpty(mLoadingView)) {
            if (EmptyUtils.isEmpty(msg)) {
                msg = "正在加载中...";
            }
            mLoadingView = new SpotsDialog(context, msg);
        }
        mLoadingView.show();
    }

    protected void hideLoading(){

        if (EmptyUtils.isNotEmpty(mLoadingView)) {
            mLoadingView.dismiss();
        }


    }

    protected void showLoading(){
        showLoading(null);
    }


}
